/**
 * @projectName study_java
 * @package State
 * @className State.NoonWork
 */
package State;

/**
 * NoonWork
 * @description 下午工作类
 * @author answer_wx
 * @date 2022/6/29 15:46
 * @version 1.0
 */
public class NoonWork implements IState {
    @Override
    public void writeProgram(Work w) {
        if (w.getHour() < 13) {
            System.out.println(String.format("当前时间%d：午休时间，睡的好舒服", w.getHour()));
        } else if (w.getHour() < 18) {
            System.out.println(String.format("当前时间%d：终于快下班了", w.getHour()));
        } else {
            w.setCurrent(new NightWork());
            w.writeProgram();
        }
    }
}